package com.example.easy.mapper;

import com.example.easy.Dto.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface NoticeMapper {

    @Insert("Insert into notice (number,title,content,time)Values(#{number},#{title},#{content},#{time})")
    int insNotice(Notice notice);//插入

    @Update("UPDATE notice  SET title=#{title},content=#{content},time=#{time} WHERE number=#{number}")
    int updateNotice (Notice notice);//修改

    @Delete("DELETE FROM notice WHERE  number=#{number}")
    int deleteNotice (int number);//删除

    @Select("SELECT * FROM notice  WHERE number=#{number} ")
    Notice selectnotice(int number);//查看文章所有信息

    @Select("SELECT * FROM notice ")
    List <Notice> selectall();//查看所有文章

}
